package com.cjh.mybatis10.reflection.invoker;

import lombok.AllArgsConstructor;

import java.lang.reflect.Field;

/**
 * @Descripton setter调用者
 * @Author cjh
 * @Date 2023/6/2 13:49
 */
@AllArgsConstructor
public class SetFieldInvoker implements Invoker {
    private Field field;
    @Override
    public Object invoke(Object target, Object[] args) throws Exception {
        field.set(target, args[0]);
        return null;
    }

    @Override
    public Class<?> getType() {
        return field.getType();
    }
}
